/**
 * 报名登记
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");

    //assets
    var template = require("./assets/tpl/signUpRegister_main.tpl");
    require("./assets/css/signUpRegister_main.css");

    //business

    //component
    var signUpRegisterSubnavComp = require("./component/signUpRegisterSubnavComp");
    var signUpRegisterGridComp = require("./component/signUpRegisterGridComp");
    var signUpRegisterFormComp = require("./component/signUpRegisterFormComp");
    var signUpRegisterApplyGridComp = require("./component/signUpRegisterApplyGridComp");
    var signUpRegisterApplyFormComp = require("./component/signUpRegisterApplyFormComp");
    var reservegrid = require("./component/reservegrid");

    var signUpRegister_main = ELView.extend({
        attrs: {
            template: template
        },
        events:{
			"click .J-grid-year-detail" :function(e){
				var grid=this.get("grid");
				var index=grid.getIndex(e.target);
				var data=grid.getData(index);
				this.openView({
					url:"eling/elcms/travel/plan/src/plan_main",
					params: {
						business:"detail",
						"data":data
					},
					isAllowBack:true
				});
			},
			 "click .J-grid-year-plan" : function(e){
				var grid=this.get("grid");
				var index=grid.getIndex(e.target);
				var data=grid.getData(index);
				this.openView({
					url:"eling/elcms/travel/plan/src/plan_main",
					params: {
						business:"detail",
						"data":data
					},
					isAllowBack:true
				});
		     }
        },
        initComponent: function (params, widget) {
        	signUpRegisterSubnavComp.initComponent(params, widget);
        	signUpRegisterGridComp.initComponent(params, widget);
        	signUpRegisterFormComp.initComponent(params, widget);
        	signUpRegisterApplyGridComp.initComponent(params, widget);
        	signUpRegisterApplyFormComp.initComponent(params, widget);
        	reservegrid.initComponent(params, widget);
        },
        afterInitComponent: function (params, widget) {
  		   widget.get("grid").refresh();
        }
    });

    module.exports = signUpRegister_main;
});
